package AB;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

public class Zuoye5 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        Calendar c = Calendar.getInstance();
        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd  EEEE");
        System.out.println("请输入年份：");
        int a=input.nextInt();
        c.set(a,5,1);
        for(int i=1,count=1;i<30;i++){
            if(c.get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY){
                if(count++==3){
                    String s=sim.format(c.getTime());
                    System.out.println(a+"年的父亲节是"+s);
                    return;
                }
            }c.add(Calendar.DAY_OF_MONTH,1);
        }
    }
}
